package com.ChenYaRou.www.dao;

import com.ChenYaRou.www.po.Collection;

import java.sql.SQLException;
import java.util.List;

/**
 * @author 86183
 */
public interface CollectionDao {
    /**
     * 新建收藏
     * @param collection 新收藏
     * @return 更新条数
     * @throws IllegalAccessException
     * @throws SQLException
     */
    int insert(Collection collection) throws IllegalAccessException, SQLException ;


    /**
     * update collection state
     * @param collection collection需要更新的值
     * @param  oldCollection old collection
     * @return 成功与否
     * @throws IllegalAccessException
     * @throws SQLException
     */
    int update(Collection collection,Collection oldCollection) throws IllegalAccessException, SQLException;

    /**
     * 删除收藏
     * @param  collection 删掉的收藏信息
     * @return 成功与否
     * @throws  SQLException
     */
    int delete(Collection collection) ;

    /**
     * 查找收藏集合
     * @param collection 条件collection
     * @return
     * @throws IllegalAccessException
     * @throws SQLException
     * @throws NoSuchFieldException
     * @throws InstantiationException
     */
    List<Collection> selectMore(Collection collection) throws IllegalAccessException,
            SQLException, NoSuchFieldException, InstantiationException ;
}
